﻿using Microsoft.Extensions.DependencyInjection;

namespace EPlantApp.Infrastructure.Extensions
{
    public static class CorsExt
    {
        public static void AddCorsExt(this IServiceCollection services)
        {
            services.AddCors(options =>
            {
                // allcore: 策略名称
                options.AddPolicy("allcore", corsBuilder =>
                {
                    corsBuilder.AllowAnyHeader()
                               .AllowAnyOrigin()
                               .AllowAnyMethod();
                });
            });
        }
    }
}
